/********注册文本框移入移出变色事件 ********/
//获取对应变量
var reg_form = document.getElementsByClassName("reg-form")[0];
var top_input = reg_form.getElementsByClassName("top_input")[0];
var top_input_2 = reg_form.getElementsByTagName("div")[1];

top_input.addEventListener("mouseover", function () {
    top_input.style.border = "1px solid #333";
})
top_input.addEventListener("mouseout", function () {
    top_input.style.border = "1px solid #DDDDDD";
})
top_input_2.addEventListener("mouseover", function () {
    top_input_2.style.border = "1px solid #333";
})
top_input_2.addEventListener("mouseout", function () {
    top_input_2.style.border = "1px solid #DDDDDD";
})



/********手机号文本框焦点事件and正则表达式********/
//获取对应变量
var input = reg_form.getElementsByTagName("input")[0];
var hidden_note = reg_form.getElementsByClassName("hidden_note")[0];
var content_right = reg_form.getElementsByClassName("content_right")[0];
var content_error = reg_form.getElementsByClassName("content_error")[0];
var iconiconcopy = reg_form.getElementsByClassName("iconiconcopy")[0];

input.addEventListener("focus", function () {
    hidden_note.style.display = "block";
})
input.addEventListener("blur", function () {
    hidden_note.style.display = "none";
    var txt = /^1(3|4|5|7|8)\d{9}$/;
    if (txt.test(this.value)) {
        content_right.style.display = "block";
        content_error.innerText = "验证完成后，你可以使用该手机登录或找回密码";
        content_error.style.color = "#999";
        iconiconcopy.style.color = "#999";
    } else {
        content_right.style.display = "none";
        content_error.innerText = "格式错误";
        content_error.style.color = "#f91";
        iconiconcopy.style.color = "#f91";
    }

})

